package lab2;

public class PyTorchFactory extends AbstractFactory{
    private static PyTorchFactory instance;
    private PyTorchFactory(){}

    public static PyTorchFactory getInstance(){
        if (instance == null){
            instance = new PyTorchFactory();
        }
        return instance;
    }

    @Override
    Dataset createDataset() {
        return new PyTorchDataset();
    }

    @Override
    Layer createLayer() {
        return new PyTorchLayer();
    }

    @Override
    LossFunction createLossFunction() {
        return new PyTorchLossFunction();
    }

    @Override
    Optimizer createOptimizer() {
        return new PyTorchOptimizer();
    }

    @Override
    Model createModel() {
        return new PyTorchModel();
    }
}
